function initDataTable(table){
	oTable = $(table).dataTable( {
		"sPaginationType": "full_numbers",
        "bLengthChange": false,
        "bDestroy": true,
        "bFilter": true,
        "bInfo": false,
        "bAutoWidth": false,
        "aaSorting": [[ 0, "desc" ]],
        "iDisplayLength": 10} );
	return oTable;
}

function initHiddenColumnDataTable(table){
	oTable = $(table).dataTable({
		"sPaginationType" : "full_numbers",
		"bLengthChange" : false,
		"bDestroy" : true,
		"bFilter" : true,
		"bInfo" : false,
		"bAutoWidth" : false,
		"aaSorting": [[ 1, "asc" ]],
		"iDisplayLength" : 10,
		"aoColumnDefs" : [

		{
			"bVisible" : false,
			"aTargets" : [ 0 ]
		} ]
	});
	return oTable;
}

function clearFormValues(form){


    // get all the inputs into an array.
    //var $inputs = $(form ':input');

    // not sure if you wanted this, but I thought I'd add it.
    // get an associative array of just the values.
    var values = {};
    $inputs.each(function() {
        $(this).val('');


    });
}

function removeSelectedRow(table){
	$(table.fnSettings().aoData).each(function() {
		$(this.nTr).removeClass('row-selected');
	});
}

//function clear(form){
//	//$(form).resetForm();
//	$(form).clearForm();
//}

function clear(form) {
	  // iterate over all of the inputs for the form
	  // element that was passed in
	  $(':input', form).each(function() {
	    var type = this.type;
	    var tag = this.tagName.toLowerCase(); // normalize case
	    // it's ok to reset the value attr of text inputs,
	    // password inputs, and textareas
	    if (type == 'text' || type == 'password' || tag == 'textarea' || type == 'email' || type == 'number')
	      this.value = "";
	    // checkboxes and radios need to have their checked state cleared
	    // but should *not* have their 'value' changed
	    else if (type == 'checkbox' || type == 'radio')
	      this.checked = false;
	    // select elements need to have their 'selectedIndex' property set to -1
	    // (this works for both single and multiple select elements)
//	    else if (tag == 'select')
//	      this.selectedIndex = -1;
	  });
	};
	
function numberMask(){
	$(".numberField").format({precision: 2,autofix:true});
	$(".priceField").format({precision: 2,autofix:true});
}